package com.last1mile.commons;

import org.apache.commons.lang.StringUtils;

public enum CurrencyEnum {
    CNY("CNY", "￥"), USD("USD", "$");

    private String value;
    private String label;

    private CurrencyEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public CurrencyEnum getCurrencyEnumByValue(String value) {
        if (StringUtils.equals(value, CurrencyEnum.CNY.getValue())) {
            return CurrencyEnum.CNY;
        }
        if (StringUtils.equals(value, CurrencyEnum.USD.getValue())) {
            return CurrencyEnum.USD;
        }
        return null;
    }
}
